<template>
  <div id="app">
    <router-view></router-view>
  </div>
</template>

<script>
import Util from './libs/util.js';
export default {
  name: 'App',
  mounted() {
  	if(!localStorage.getItem('token')) {
  		Util.ajax.post('', {
	  		method: 'api.manage.admin.public.login',
	  		username: 'admin',
	  		password: '123123'
	  	}).then(res => {
	  		localStorage.token = res.token;
	  		this.$store.commit('setUserInfo', res.info);
	  		this.$store.commit('setSiteInfo', res.siteBasic);
	  	})
  	}
  }
}
</script>